package com.hhc.combined;

/**
 * 构建一个树形结构，表示学校、学院和院系的层次结构。
 */
public class T {
    public static void main(String[] args) {
        Component school = new School("清华大学");

        Component college1 = new College("计算机学院");
        college1.add(new Department("软件工程"));
        college1.add(new Department("网络工程"));

        Component college2 = new College("信息工程学院");
        college2.add(new Department("通信工程"));
        college2.add(new Department("信息工程"));

        school.add(college1);
        school.add(college2);

        school.display();
    }
}
